package demo02;

import java.util.Scanner;

/*题目：两个字符串连接程序*/
public class topic46 {
    public static void main(String[] args) {
        System.out.print("请输入两段字符串: ");
        Scanner sc = new Scanner(System.in);
        String str1 = sc.next();
        String str2 = sc.next();
        char[] ch2 = str2.toCharArray();

        StringBuffer sb = new StringBuffer(str1);
        sb = sb.append(ch2);
        String str = sb.toString();
        System.out.println("两段字符串连接后为: "+str);

    }
}
